package project.menu.garagemenu;

import api.controller.IAutoservice;
import project.controllers.Controller;
import project.controllers.Messager;
import project.controllers.Printer;
import project.menu.IMenu;
import project.menu.IMenuItem;
import project.work.Navigator;

public class RemoverGarage implements IMenuItem {

	private String name = "Delete garage";
	private final Integer id = 5;
	private static IMenu submenu;
	private Controller controller;
	private Navigator navigator;

	public RemoverGarage() {
		controller = Controller.getInstance();
		navigator = Navigator.getInstance();
	}

	public static void setSubmenu(IMenu menu) {
		submenu = menu;
	}

	public void action(IAutoservice autoservice) {
		// delete garage

		autoservice.deleteGarage(controller.getNumberGarage());
		Printer.printMessage(Messager.GARAGE_DELETE);
		navigator.drawMenu(submenu);
	}

	public String getNameItem() {

		return name;
	}

	public Integer getId() {
		return id;
	}

}
